// 判断本地存储是否还有 useInfo 字段如果有就 return true 没有 就 return false

import { useState } from "react";
export default function (initialState:object) {
    let [useInfo,setInfo] = useState(initialState)

    let isLogin = JSON.parse(localStorage.getItem("useInfo")||'{}')

   function setUserInfo(newState:object){
        setInfo(newState)
    }

    return [isLogin,setUserInfo]
}